/*
 *    Copyright 2009-2025 the original author or authors.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       https://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package org.apache.ibatis.submitted.auto_type_from_non_ambiguous_constructor;

import org.apache.ibatis.annotations.Arg;
import org.apache.ibatis.annotations.ConstructorArgs;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface Mapper1 {

  String SELECT_SQL = "select a.id, a.name, a.type from account a where a.id = #{id}";
  String SELECT_WITH_DOB_SQL = "select id, name, type, date '2025-01-05' dob from account where id = #{id}";

  @ConstructorArgs({ @Arg(column = "id"), @Arg(column = "name"), @Arg(column = "type") })
  @Select(SELECT_SQL)
  Account getAccountJavaTypesMissing(long id);

  @ConstructorArgs({ @Arg(column = "id"), @Arg(column = "name", javaType = String.class), @Arg(column = "type") })
  @Select(SELECT_SQL)
  Account3 getAccountPartialTypesProvided(long id);

  @ConstructorArgs({ @Arg(column = "name", name = "accountName"), @Arg(column = "dob", name = "accountDob"),
      @Arg(column = "id", name = "accountId") })
  @Select(SELECT_WITH_DOB_SQL)
  Account4 getAccountWrongOrder(long id);
}
